package com.feeyo.groundservice.checkin.base

import com.feeyo.groundservice.http.constant.DEFAULT_NORMAL_CODE
import com.feeyo.groundservice.http.core.IBaseBean

/**
 *作者：QLH on 2023-09-15
 *描述：
 */

internal object GlobalHandler {
    /**BaseBean实现**/
    val baseBean = object : IBaseBean {
        override fun getCodeKey(): String {
            return "code"
        }

        override fun getMsgKey(): String {
            return "msg"
        }

        override fun getServerTimeKey(): String {
            return "time"
        }

        override fun getDataKey(): String {
            return "data"
        }

        override fun isRequestSuccess(code: Int): Boolean {
            return code == if (hasCodeKey()) 0 else DEFAULT_NORMAL_CODE
        }

    }
}